package com.sx.gongzhong.pest;

import com.sx.gongzhong.model.HeadParamBean;
import com.sx.gongzhong.model.LegalAdviceTypeBean;
import com.sx.gongzhong.model.ReplyUserBean;
import com.sx.gongzhong.net.BaseCallBack;
import com.sx.gongzhong.net.LegalAdviceManager;
import com.sx.gongzhong.view.LegalTypeSelectView;

import java.util.List;
import java.util.Map;

/**法律咨询类型选择
 * Created by admin on 2018/1/12.
 */

public class LegalTypeSelectPest {
    private LegalTypeSelectView legalTypeSelectView;

    public LegalTypeSelectPest(LegalTypeSelectView legalTypeSelectView) {
        this.legalTypeSelectView = legalTypeSelectView;
    }
    public void getLegalTypeSelectListData() {
        Map<String,Object> map = HeadParamBean.getHead();
        new LegalAdviceManager().getLegalTypeSelectListData(map, new BaseCallBack<ReplyUserBean.BaseResult<List<LegalAdviceTypeBean>>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<List<LegalAdviceTypeBean>> response) {
                legalTypeSelectView.getSuccess(response.data);
            }
            @Override
            public void onFailures(String message) {
                legalTypeSelectView.showError(message);
            }
        });
    }
}
